import { BasicColumn, FormSchema } from '@/components/Table';

export const ColumnPage: BasicColumn[] = [
  {
    title: '会员账号',
    dataIndex: 'username',
  },
  {
    title: '昵称',
    dataIndex: 'nickname',
  },
  {
    title: '会员等级',
    dataIndex: 'memberLevelName',
  },
  {
    title: '余额',
    dataIndex: 'balance',
  },
  {
    title: '积分',
    dataIndex: 'point',
  },
  {
    title: '订单总数',
    dataIndex: 'orderNum',
  },
  {
    title: '消费总额',
    dataIndex: 'orderMoney',
  },
  {
    title: '添加时间',
    dataIndex: 'createTime',
    width: 150,
    fixed: 'right',
    sorter: true,
    customRender: ({ record }) => {
      return record.createTime?.substring(0, 16);
    },
  },
  {
    title: '最后登录时间',
    dataIndex: 'createTime',
    width: 150,
    fixed: 'right',
    sorter: true,
    customRender: ({ record }) => {
      return record.createTime?.substring(0, 16);
    },
  },
];

export const SearchForm: FormSchema[] = [
  {
    field: 'title',
    label: '会员账号',
    component: 'Input',
    colProps: { span: 8 },
  },
];

export const FormSchemaAdd: FormSchema[] = [
  {
    field: 'username',
    label: '会员账号',
    component: 'Input',
    required: true,
    colProps: { span: 12 },
  },
  {
    field: 'nickname',
    label: '昵称',
    component: 'Input',
    required: true,
    colProps: { span: 12 },
  },
  {
    field: 'password',
    label: '密码',
    component: 'InputPassword',
    required: true,
    colProps: { span: 12 },
  },
];

// 详情++++++++++++++++++++++++
export const ColumnPageBalance: BasicColumn[] = [
  {
    title: '调整金额',
    dataIndex: 'num',
  },
  {
    title: '账户金额',
    dataIndex: 'remainNum',
  },
  {
    title: '发生方式',
    dataIndex: 'changeTypeText',
  },
  {
    title: '描述',
    dataIndex: 'desc',
  },
  {
    title: '添加时间',
    dataIndex: 'createTime',
    width: 150,
    fixed: 'right',
    sorter: true,
  },
];
